{% extends "base.jinja" %}

{% block title %}加入婚礼服务服务商{% endblock %}

{% block css %},supplier.css{% endblock %}

{% block main %}
	{% if not supplier_data %}
    <div class="layout su-join" id="su-join">
		<div class="su-join-main">
			<h3>免费开通商家空间</h3>
			<div class="su-join-form">
				<form method="post">
					<table>
						<tbody>
							<tr>
								<th width="90"><span>*</span>商家名称</th>
								<td>
									<input data-error="请填写商家名称" data-reg="^[\S]+$" type="text" class="inp-text" name="company" value="" />
									<span class="ui-a su-result"></span>
								</td>
							</tr>
							<tr>
								<th><span>*</span>服务分类</th>
								<td>
									<div class="ui-a su-service">
										<input data-error="请选择服务分类" data-reg="^[\S]+$" type="hidden" name="service-id" value="" />
										<input readonly="readonly" type="text" class="inp-text" id="service-name" name="service" value="" />
										<span class="ui-a su-result"></span>
										<dl id="service-cate">
											<dt>选择(最多选择3个) <a href="javascript:;">确定</a></dt>
											<dd>
												{% for c in service_cate %}
													<label class="inp-checkbox"><input type="checkbox" name="service_id" value="{{c.id}}" data-name="{{c.name}}">{{c.name}}</label>
												{% endfor %}
											</dd>
										</dl>
									</div>
								</td>
							</tr>
							<tr>
								<th><span>*</span>所在城市</th>
								<td>
									<input data-error="请选择所在城市" data-reg="^[\S]+$" type="hidden" name="city-id" value="" />
									<input id="su-city" type="text" class="inp-text" name="city" value="" />
									<span class="ui-a su-result"></span>
								</td>
							</tr>
							<tr>
								<th>实体店地址</th>
								<td>
									<input type="text" autocomplete="off" class="inp-text" name="address" id="map-address" value="" />
								</td>
							</tr>
							<tr>
								<th>地图设置</th>
								<td>
									<input type="hidden" name="map" id="map-point" value="" />
									<div class="su-map" id="su-map"></div>
								</td>
							</tr>
							<tr>
								<th><span>*</span>服务地域范围</th>
								<td>
									<input data-error="请选择服务地域范围" data-reg="^[\S]+$" type="hidden" name="area-id" value="" />
									<input id="su-area" type="text" class="inp-text" name="service-area" value="" />
									<span class="ui-a su-result"></span>
								</td>
							</tr>
							<tr>
								<th><span>*</span>联系人姓名</th>
								<td>
									<input data-error="请填写联系人姓名" data-reg="^[\S]+$" type="text" class="inp-text" name="name" value="" />
									<span class="ui-a su-result"></span>
								</td>
							</tr>
							<tr>
								<th><span>*</span>移动电话</th>
								<td>
									<input data-error="请填写移动电话" data-reg="^[\d]{11}$" type="text" class="inp-text" name="phone" value="" />
									<span class="ui-a su-result"></span>
								</td>
							</tr>
							<tr>
								<th>固定电话</th>
								<td>
									<input type="text" class="inp-text" name="tel" value="" />
								</td>
							</tr>
							<tr>
								<th>电子邮件</th>
								<td>
									<input type="text" class="inp-text" name="email" value="" />
								</td>
							</tr>
							<tr>
								<th>客服QQ</th>
								<td>
									<input type="text" class="inp-text" name="qq" value="" />
								</td>
							</tr>
							<tr>
								<th>官网</th>
								<td>
									<input type="text" class="inp-text" name="site" value="http://" />
								</td>
							</tr>
							<tr>
								<th></th>
								<td class="su-join-protocol">
									<label class="inp-checkbox">
										<input data-error="请先同意婚礼服务商协议" id="protocol" type="checkbox" name="protocol" value="1" />
									</label>
									<a target="_blank" href="http://s.lovewith.me/static/other/%E5%A9%9A%E7%A4%BC%E6%97%B6%E5%85%89%E5%A9%9A%E7%A4%BC%E6%9C%8D%E5%8A%A1%E5%95%86%E5%8D%8F%E8%AE%AE.doc">阅读并同意婚礼服务商协议</a>
									<span class="ui-a su-result"></span>
								</td>
							</tr>
						</tbody>
						<tfoot>
							<tr>
								<th></th>
								<td><a href="javascript:;" class="inp-btn-pk">确定</a></td>
							</tr>
						</tfoot>
					</table>
				</form>
			</div>
		</div>
		<div class="su-join-side">
			<h5>相关问题？</h5>
			<ul>
				<li><a target="_blank" href="{{domain}}site/help/#supplier-i1">1.&nbsp;&nbsp;什么是婚礼服务商？</a></li>
				<li><a target="_blank" href="{{domain}}site/help/#supplier-i2">2.&nbsp;&nbsp;如何加入婚礼服务商？</a></li>
				<li><a target="_blank" href="{{domain}}site/help/#supplier-i3">3.&nbsp;&nbsp;婚礼服务商如何被推荐？</a></li>
			</ul>
		</div>
	</div>
	{% else %}
	<div class="layout su-join su-examine">
		{% if not view_module %}
		<h3>服务商申请审核中</h3>
		{% else %}
		<h3>{{supplier_data.company}}的资料</h3>
		{% endif %}
		<table>
			{% if not view_module %}
			<caption>我们会在2个工作日内审核您的资料，并短信通知您审核结果。跳转到 <a href="/u/{{supplier_data.user_id}}/">个人主页</a></caption>
			{% endif %}
			<tbody>
				<tr>
					<th width="90">用户</th>
					<td><a target="_blank" href="{{domain}}u/{{supplier_data.user_id}}">{{supplier_data.user.username}}</a></td>
				</tr>
				<tr>
					<th>商家名称</th>
					<td>{{supplier_data.company}}</td>
				</tr>
				<tr>
					<th>服务分类</th>
					<td>
						<ul class="su-ex-service" id="su-ex-service">
						{% for t in service_type %}
							<li>{{t.service.name}} {% if view_module %}<a class="ui" href="javascript:;" data-supplierid="{{t.supplier_id}}" data-serviceid="{{t.service_id}}">删除</a>{% endif %}</li>
						{% endfor %}
						</ul>
					</td>
				</tr>
				<tr>
					<th>所在城市</th>
					<td>{{supplier_data.city.province.name}} - {{supplier_data.city.name}}</td>
				</tr>
				<tr>
					<th>实体店地址</th>
					<td>{{supplier_data.address}}</td>
				</tr>
				<tr>
					<th>服务地域范围</th>
					<td>
						<ul>
						{% for a in service_area %}
							<li>{{a.city.name}}</li>
						{% endfor %}
						</ul>
					</td>
				</tr>
				<tr>
					<th>联系人姓名</th>
					<td>{{supplier_data.name}}</td>
				</tr>
				<tr>
					<th>移动电话</th>
					<td>{{supplier_data.phone}}</td>
				</tr>
				<tr>
					<th>固定电话</th>
					<td>{{supplier_data.tel}}</td>
				</tr>
				<tr>
					<th>电子邮件</th>
					<td>{{supplier_data.email}}</td>
				</tr>
				<tr>
					<th>QQ</th>
					<td>{{supplier_data.qq}}</td>
				</tr>
				<tr>
					<th>官网</th>
					<td>{{supplier_data.site}}</td>
				</tr>
			</tbody>
		</table>
	</div>
	{% endif %}
    
{% endblock %}

{% block script %}
{% if not supplier_data %}
<script>seajs.use('page/supplier/join', function(m){m.render();});</script>
{% endif %}
{% if view_module %}
<script>seajs.use('page/supplier/view-info', function(m){m.render();});</script>
{% endif %}
{% endblock %}